package com.dljd.javase.t13;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class Test {
    public static void main(String[] args) {
        getAllSupportedCityes();
    }

    public static void getAllSupportedCityes(){
        try {
            URL url=new URL("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName?theCityName=%E6%AD%A6%E6%B1%89");
            URLConnection connection=url.openConnection();

            InputStream in= connection.getInputStream();

            BufferedReader reader=new BufferedReader(new InputStreamReader(in));
            String message=null;
            while((message=reader.readLine())!=null){
                System.out.println(message);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally {

        }
    }
}
